#ifndef BINSRCHTREE_H
#define BINSRCHTREE_H
#include "constants.h"
#include "header.h"
typedef struct bst_node
{
    struct fileDescriptor *fileDes;
    char *key;
    struct bst_node *left;
    struct bst_node *right;
    struct bst_node *parent;
} b_node;


int init_bst(b_node* tree, fdesc* inp);

void bst_display(b_node* tree);

b_node* edit_fd(fdesc *fd);

fdesc* bst_search_fd(b_node* tree, char * find);

b_node* bst_search(b_node* tree, char* find);

void gen_key(char* gen, fdesc* gen_fd);

int bst_insert(b_node* tree,fdesc* inp);

void transplant(b_node* tree,b_node* u, b_node* v);

b_node* tree_min(b_node* val);
/*
fdesc* getdesc(char dir[],char file[], char type[]);
*/
int bst_remove(b_node* tree,fdesc* rem);

void bst_rem(b_node* tree, b_node* elim);

int bst_empty(b_node *tree);

int empty(b_node * tree);

#endif
